<?php
/**
* @version $Id: install.php 3136 2007-12-30 17:41:20Z Sigrid Suski $
* @package: Sigsiu Online Business Index 2
* @subpackage download plugin
* ===================================================
* @author
* Name: Sigrid & Radek Suski, Sigsiu.NET
* Email: ycatalog@sigsiu.net
* Url: http://www.sigsiu.net
* ===================================================
* @copyright Copyright (C) 2007 Sigsiu.NET (http://www.sigsiu.net). All rights reserved.
* @license see http://www.gnu.org/copyleft/gpl.html GNU/GPL.
* YCATALOG2 Download Plugin is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation.
*/
	defined( '_YCATALOG_' ) || ( trigger_error("Restricted access", E_USER_ERROR) && exit() );
	if(defined("_YCATALOG_ADM_PATH")) {
		$installPath = _YCATALOG_ADM_PATH.DS."includes".DS."install".DS."download";
		require_once(_YCATALOG_CMSROOT.DS."administrator".DS."includes".DS."pcl".DS."pclzip.lib.php");
		$zipfile = new PclZip($installPath.DS."mimetypes.zip");
		if(!$zipfile->extract(PCLZIP_OPT_PATH, _YCATALOG_FE_PATH.DS."plugins".DS."download".DS)) {
			trigger_error("Could not extract mimetypes icons");
		}
	}
	else {
		$url = "index2.php?option=com_ycatalog&task=pluginsManager&mosmsg=".urlencode("The download plugin requires at least YCATALOG2 RC 2.8.0. Please uninstall this plugin and update your YCATALOG2 version");
		@ob_end_clean();
		header( 'HTTP/1.1 301 Moved Permanently' );
		header( "Location: ". $url );
		exit();
	}
?>